import Vue from 'vue'
import Router from 'vue-router'
const Home = () => import('../components/Home');
const Demo1 = () => import('../components/Demo1');
const Demo2 = () => import('../components/Demo2');
const Demo3 = () => import('../components/Demo3');


//注册路由插件
Vue.use(Router)

export  default  new Router({
    //使用说明方式切换路由 hash / history
    mode: 'history',    //html5的history api
    //跟路径
    base: "/",
    routes: [
        {
            path: '/',
            name: 'home',
            component: Home
        },
        {
            path: '/demo1',
            name: 'demo1',
            component: Demo1
        },
        {
            path: '/demo2',
            name: 'demo2',
            component: Demo2
        },
        {
            path: '/demo3',
            name: 'demo3',
            component: Demo3
        },
    ]
})